<!--
 * @Author: mjjh
 * @LastEditTime: 2023-04-09 17:26:12
 * @FilePath: \chagpt-shuowen\src\components\UserAvatar\index.vue
 * @Description: 头像配置 自动从pinia中读取数据
-->
<script setup lang='ts'>
import { NAvatar } from 'naive-ui'
import defaultAvatar from '@/assets/images/avatar.jpg'
import { isString } from '@/utils/is'

</script>

<template>
  <div class="flex items-center overflow-hidden">
    <div class="w-10 h-10 overflow-hidden rounded-full shrink-0">
<!--      <template v-if="isString(avatar) && avatar.length > 0">-->
<!--        <NAvatar-->
<!--          size="large"-->
<!--          round-->
<!--          :src="avatar"-->
<!--          :fallback-src="defaultAvatar"-->
<!--        />-->
<!--      </template>-->
      <template>
        <NAvatar size="large" round :src="defaultAvatar" />
      </template>
    </div>
    <div class="flex-1 min-w-0 ml-2">
      <h2 class="overflow-hidden font-bold text-md text-ellipsis whitespace-nowrap">
<!--        {{ username ?? $t('chat.defaultName') }}-->
          测试人员
      </h2>

      <!-- <p class="overflow-hidden text-xs text-gray-500 text-ellipsis whitespace-nowrap">
        <span
          v-if="isString(userInfo.description) && userInfo.description !== ''"
          v-html="userInfo.description"
        />
      </p> -->
    </div>
  </div>
</template>
